package com.xbx.baseweb.entity.email;

import lombok.Data;

/**
 * 邮箱发送结果
 */
@Data
public class EmailSendResult {
    /**
     * 0=发送成功 -10X=请求参数错误 -101=参数为空 -102=模板错误 -103=邮件主题不能为空 -104=邮件接收不能为空 -105=添加附件时异常 -106=构造邮件内容异常
     * -20X 邮件发送过程中发生异常 -201=邮件发送异常
     */
    private int code;
    private String msg;

    public static EmailSendResult build(int code, String msg) {
        EmailSendResult result = new EmailSendResult();
        result.setCode(code);
        result.setMsg(msg);
        return result;
    }

    public static EmailSendResult build(int code) {
        EmailSendResult result = new EmailSendResult();
        result.setCode(code);
        return result;
    }
}
